package com.bosssoft.cloud.wechat.core.bean.template;

/**
 * 行业enum
 *
 * @author wcy create on 2021/7/1 14:35 下午
 */
public enum WxTemplateIndustryEnum {
    /**
     * 博思电子票据查验所在行业1（未确定，暂用）
     */
    E_COMMERCE("IT科技", "互联网|电子商务", 1),
    /**
     * 博思电子票据查验所在行业2（未确定，暂用）
     */
    IT_SOFTWARE_AND_SERVICES("IT科技", "IT软件与服务", 2),
    IT_HARDWARE_AND_EQUIPMENT("IT科技", "IT硬件与设备", 3),
    ELECTRONIC_TECHNIQUE("IT科技", "电子技术", 4),
    COMMUNICATION_AND_OPERATOR("IT科技", "通信与运营商", 5),
    ONLINE_GAME("IT科技", "网络游戏", 6),
    BANK("金融业", "银行", 7),
    FUND("金融业", "证券基金理财信托", 8),
    INSURANCE("金融业", "保险", 9),
    REPAST("餐饮", "餐饮", 10),
    HOTEL("酒店旅游", "酒店", 11),
    TRAVEL("酒店旅游", "旅游", 12),
    EXPRESS("运输与仓储", "快递", 13),
    LOGISTICS("运输与仓储", "物流", 14),
    STORAGE("运输与仓储", "仓储", 15),
    CULTIVATE("教育", "培训", 16),
    ACADEMY("教育", "院校", 17),
    ACADEMIC_RESEARCH("政府与公共事业", "学术科研", 18),
    TRAFFIC_POLICE("政府与公共事业", "交警", 19),
    MUSEUM("政府与公共事业", "博物馆", 20),
    PUBLIC_WORKS_NONPROFIT("政府与公共事业", "公共事业非盈利机构", 21),
    MEDICAL_HEALTH("医药护理", "医药医疗", 22),
    CARE_AND_BEAUTY("医药护理", "护理美容", 23),
    HEALTH_AND_HYGIENE("医药护理", "保健与卫生", 24),
    AUTOMOTIVE_RELATED("交通工具", "汽车相关", 25),
    MOTORCYCLE_CORRELATION("交通工具", "摩托车相关", 26),
    THE_TRAIN_RELATED("交通工具", "火车相关", 27),
    THE_PLANE_RELATED("交通工具", "飞机相关", 28),
    ARCHITECTURE("房地产", "建筑", 29),
    REAL_ESTATE("房地产", "物业", 30),
    CONSUMER_GOODS("消费品", "消费品", 31),
    LEGISLATION("商业服务", "法律", 32),
    CONVENTION_AND_EXHIBITION("商业服务", "会展", 33),
    INTERMEDIARY_SERVICES("商业服务", "中介服务", 34),
    AUTHENTICATION("商业服务", "认证", 35),
    AUDIT("商业服务", "审计", 36),
    MASS_MEDIA("文体娱乐", "传媒", 37),
    SPORTS("文体娱乐", "体育", 38),
    LEISURE_AND_ENTERTAINMENT("文体娱乐", "娱乐休闲", 39),
    PRINTING("印刷", "印刷", 40),
    OTHER("其它", "其它", 41);

    public final String firstClass;
    public final String secondClass;
    public final Integer code;

    public static WxTemplateIndustryEnum findByClass(String firstClass, String secondClass) {
        WxTemplateIndustryEnum[] enumArray = values();
        int l = enumArray.length;

        for (int i = 0; i < l; ++i) {
            WxTemplateIndustryEnum industryEnum = enumArray[i];
            if (industryEnum.firstClass.equals(firstClass) && industryEnum.secondClass.contains(secondClass)) {
                return industryEnum;
            }
        }

        return null;
    }

    public static WxTemplateIndustryEnum findByCode(int code) {
        WxTemplateIndustryEnum[] enumArray = values();
        int l = enumArray.length;

        for (int i = 0; i < l; ++i) {
            WxTemplateIndustryEnum industryEnum = enumArray[i];
            if (industryEnum.code == code) {
                return industryEnum;
            }
        }
        return null;
    }

    public String getFirstClass() {
        return this.firstClass;
    }

    public String getSecondClass() {
        return this.secondClass;
    }

    public Integer getCode() {
        return this.code;
    }

    private WxTemplateIndustryEnum(String firstClass, String secondClass, Integer code) {
        this.firstClass = firstClass;
        this.secondClass = secondClass;
        this.code = code;
    }
}
